package com.zengjianjun.es.demo.highlevelclient.interceptor;

import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpResponse;
import org.apache.http.HttpResponseInterceptor;
import org.apache.http.protocol.HttpContext;

/**
 * @author zengjianjun
 */
@Slf4j
public class ElasticsearchResponseInterceptor implements HttpResponseInterceptor {

    @Override
    public void process(HttpResponse response, HttpContext context) {
        // 在响应后拦截，打印响应结果
        log.info("Elasticsearch Response: {}", response.getStatusLine());
    }
}
